This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Add opt-in versioned row publication mode - #186
Closed
pathscale wants to merge 2 commits into
Closed
Conversation
Owner
Author
|
Superseded by #187, which consolidated and merged the backend-selection and publication hardening work after the combined review and validation rounds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
versioned-row-publicationmode for generated reads that overlap row mutationArc<Row>versions while retaining archived pages as the persistence/mutation imageThis draft is stacked on #185 because it includes the unique point-read predicate revalidation from that PR.
Contract
With the feature enabled, generated reads return a complete old or new owned row version and never deserialize concurrently-mutated archived bytes. Insert ghosts and deleted rows are not returned, and retired links/pages are not reused until pre-existing generated readers drain.
This is not MVCC or a snapshot-isolation implementation. Range scans may include or omit rows changed during the scan. The guarantee excludes callers that bypass generated table methods and directly mutate low-level
Datapages. Point-read retry may starve under perpetual replacement churn.The protocol and scope are documented in
docs/versioned-row-publication.md.Validation
cargo test --all-targets: 115 unit tests and 326 active integration tests passed (5 ignored)cargo test --all-targets --features versioned-row-publication: 119 unit tests and 328 active integration tests passed (5 ignored)cargo clippy --all-targets -- -D warningscargo clippy --all-targets --features versioned-row-publication -- -D warningscargo fmt --all -- --checkFeature-only deterministic tests cover incomplete multi-field page mutation, ghost visibility, retired-version lifetime, physical-link ABA prevention, and integer/float range predicate revalidation.
Performance
Five alternating Criterion runs per mode on Darwin arm64, 20 samples/run, 0.2 s warmup, and 0.5 s measurement. The one-row range result uses seven alternating runs, 25 samples/run, 0.3 s warmup, and 0.7 s measurement after a shorter run showed excess variance.
Replacing the ordered publication index with the offset-keyed registry reduced the feature-on primary read from 96.811 ns to 61.058 ns and the feature-on unique read from 92.974 ns to 66.339 ns. Seven direct paired old/new runs also measured the optimized unique-index update 2.09% faster than the prior PR implementation. Read-only scaling and 2/4/8-writer contention checks showed no regression from the registry change.
The remaining feature-on cost is still material for latency-sensitive deployments. The feature remains off by default; feature-off point/read/write differences are at or below 1.02% in the final set.
Before merge